/*
 * Copyright 2020-2030 ALPHA LAB.Inc All Rights Reserved.
 */
package com.alphalab.framework.domain.dto;

import java.util.List;

/**
 * 多个结果集对象.
 * @author allen
 * @version 1.0.0 2020年3月2日
 */
public class ListResultVO<T> extends ResultVO {
	
	/**
	 * list结果集.
	 */
	private List<T> list;
	
	public ListResultVO() {}
	
	/**
	 * 构造正常情况下结果对象.
	 * @param data 结果集
	 */
	public ListResultVO(List<T> list) {
		super.setSuccessResult();
		this.list = list;
	}
	
	/**
	 * 构造异常情况下结果对象.
	 * @param throwable Throwable异常
	 */
	public ListResultVO(Throwable throwable) {
		super(throwable);
	}

	/**
	 * 构造异常情况下结果对象.
	 * @param errorCode 错误码
	 * @param errorMsg 错误信息
	 */
	public ListResultVO(String errorCode, String errorMsg) {
		super(errorCode, errorMsg);
	}
	
	/**
	 * 构造异常情况下结果对象.
	 * @param errorCode 错误码
	 * @param errorMsg 错误信息
	 * @param throwable Throwable异常
	 */
	public ListResultVO(String errorCode, String errorMsg, Throwable throwable) {
		super(errorCode, errorMsg, throwable);
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}
	
	@Override
	public String toString() {
		return "ListResultVO [list.size=" + (list == null ? 0 : list.size()) + 
				", code=" + code + ", msg=" + msg + ", success=" + success + "]";
	}

}
